#pragma once
#include "MessageResolver.h"

namespace Lumin {
namespace Win32 {

class CSocketSession
{
public:
	CSocketSession(DWORD dwContext=0);
	~CSocketSession(void);
	void Shutdown();
	BOOL IsConnected();
	void SendPacket(const PACKET& packet);
	IConnection* GetConnection(){return m_pConnection;}
	DWORD GetContext(){return m_dwContext;}
	DWORD GetData(){return m_dwData;}
	void SetConnectionPtr(IConnection* pConnection);
	void SetData(DWORD dwData){m_dwData = dwData;}
	static void *operator new(size_t objSize);
	static void operator delete(void *pObj, size_t bufferSize);
	const char* GetAddress(){return m_address.c_str();}
public:
	CMessageResolver m_Resolver;
private:
	IConnection* m_pConnection;
	DWORD m_dwContext;
	DWORD m_dwData;
	string m_address;
};

}
}
